package com.xnyzc.lhy.mis.controller.cmsapi.worksheet;


import com.xnyzc.lhy.common.entity.DiDiRv;
import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.worksheet.WorksheetGetOutgoingPhoneNumberParam;
import com.xnyzc.lhy.mis.service.worksheet.IOaSysWorksheetCallService;
import com.xnyzc.lhy.mis.service.worksheet.IOaSysWorksheetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 工单呼叫记录 前端控制器
 * </p>
 *
 * @author cuixiaojian
 * @since 2019-11-04
 */
@RestController
@Api(value="工单呼叫记录",tags={"工单呼叫记录"})
@RequestMapping("/worksheetcall")
public class OaSysWorksheetCallController {

    @Autowired
    IOaSysWorksheetCallService iOaSysWorksheetCallService;
    /**
     * 根据合力工单号获取外呼电话号码
     *
     * @param worksheetGetOutgoingPhoneNumberParam
     * @return
     */
    @ApiOperation(value = "通过合力工单号获取外呼电话号码", notes = "通过合力工单号获取外呼电话号码")
    @PostMapping(value = "/queryGetOutgoingPhoneNumber")
    public DiDiRv queryGetOutgoingPhoneNumber(@RequestBody WorksheetGetOutgoingPhoneNumberParam worksheetGetOutgoingPhoneNumberParam) {
        return iOaSysWorksheetCallService.queryGetOutgoingPhoneNumber(worksheetGetOutgoingPhoneNumberParam);
    }


    /**
     * 挂电话
     *
     * @param callId
     * @return
     */
    @ApiOperation(value = "挂电话", notes = "挂电话")
    @GetMapping(value = "/hangUp")
    public Rv hangUp(String callId) {
        return iOaSysWorksheetCallService.hangUp(callId);
    }

    /**
     * 获取合力用户信息
     *
     * @param
     * @return
     */
    @ApiOperation(value = "获取合力用户信息", notes = "获取合力用户信息")
    @GetMapping(value = "/getUserInfo")
    public Rv getUserInfo() {
        return iOaSysWorksheetCallService.getUserInfo();
    }
}
